From: Florian Müllner Date: Sun, 28 Jun 2020 00:45:18 +0000 (+0200) Subject: overviewControls: Handle overlay key X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~616^2^2~223 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=1ad45a8232d2473e8f62e4b9b4c079eafcffdb59;p=gnome-shell.git overviewControls: Handle overlay key It's where all the fun state is handled now, so move the super-key handling there as well, in preparation of making it a bit more sophisticated. Part-of: --- diff --git a/js/ui/main.js b/js/ui/main.js index 94c43dcce..bf7b6acc1 100644 --- a/js/ui/main.js +++ b/js/ui/main.js @@ -50,8 +50,6 @@ const ParentalControlsManager = imports.misc.parentalControlsManager; const Config = imports.misc.config; const Util = imports.misc.util; -const A11Y_SCHEMA = 'org.gnome.desktop.a11y.keyboard'; -const STICKY_KEYS_ENABLE = 'stickykeys-enable'; const WELCOME_DIALOG_LAST_SHOWN_VERSION = 'welcome-dialog-last-shown-version'; // Make sure to mention the point release, otherwise it will show every time // until this version is current @@ -96,7 +94,6 @@ var locatePointer = null; let _startDate; let _defaultCssStylesheet = null; let _cssStylesheet = null; -let _a11ySettings = null; let _themeResource = null; let _oskResource = null; @@ -238,13 +235,6 @@ function _initializeUI() { new PointerA11yTimeout.PointerA11yTimeout(); - _a11ySettings = new Gio.Settings({ schema_id: A11Y_SCHEMA }); - - global.display.connect('overlay-key', () => { - if (!_a11ySettings.get_boolean(STICKY_KEYS_ENABLE)) - overview.toggle(); - }); - global.connect('locate-pointer', () => { locatePointer.show(); }); diff --git a/js/ui/overviewControls.js b/js/ui/overviewControls.js index 1e276635b..3116df487 100644 --- a/js/ui/overviewControls.js +++ b/js/ui/overviewControls.js @@ -16,6 +16,8 @@ const WorkspacesView = imports.ui.workspacesView; const SMALL_WORKSPACE_RATIO = 0.15; const DASH_MAX_HEIGHT_RATIO = 0.15; +const A11Y_SCHEMA = 'org.gnome.desktop.a11y.keyboard'; + var SIDE_CONTROLS_ANIMATION_TIME = Overview.ANIMATION_TIME; var ControlsState = { @@ -363,6 +365,15 @@ class ControlsManager extends St.Widget { }, }); + this._a11ySettings = new Gio.Settings({ schema_id: A11Y_SCHEMA }); + + global.display.connect('overlay-key', () => { + if (this._a11ySettings.get_boolean('stickykeys-enable')) + return; + + Main.overview.toggle(); + }); + Main.wm.addKeybinding( 'toggle-application-view', new Gio.Settings({ schema_id: WindowManager.SHELL_KEYBINDINGS_SCHEMA }),